﻿using BL_Client.ServiceReference1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UI
{
    public partial class Login : System.Web.UI.Page
    {
        static BL_Client.IBL bl;

        public Login()
        {
            bl = new BL_Client.BL();
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            User user = bl.GetUserByEmail(txtEmail.Text);

            if (user != null && txtPassword.Text == user.Password)
                FormsAuthentication.RedirectFromLoginPage(user.Email, false);
        }
    }
}